﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Mrj_Shop.aspx.cs" Inherits="Mrj_Shop" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>美人计店铺对照表</title>
    <script src="../js/extTools.js" type="text/javascript"></script>
    <script src="../js/jquery/jquery-1.8.1.min.js" type="text/javascript"></script>
    <style>
        .x-grid-row-over .x-grid-cell-inner
        {
            font-weight: bold;
        }
        .x-column-header-inner
        {
            height: 28px;
            background: #E7EBEF url(./images/header.png) repeat-x 0 0;
        }
    </style>
    <script>
        var onRowDoubleClick = function (grid, rowIndex, e) {
            //alert(grid.getStore().getAt(rowIndex));
//            var selectionModel = grid.getSelectionModel();
//            var record = selectionModel.getSelected();
//            alert(record.data.美人计店铺编号);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Crisp" />
        <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">
            <Items>
                <ext:Hidden ID="FormatType" runat="server" />
                <ext:Hidden ID="hd_mrjshopid" runat="server" />
                <ext:GridPanel ID="GridPanel1" runat="server" TitleAlign="Center">
                    <TopBar>
                        <ext:Toolbar ID="Toolbar1" runat="server" Layout="ColumnLayout">
                            <Items>
                                <ext:MultiCombo ID="comShop" runat="server" SelectionMode="All" FieldLabel="店铺" LabelWidth="60"
                                    DisplayField="shopname" ValueField="shopid">
                                    <Store>
                                        <ext:Store ID="Store2" runat="server">
                                            <Model>
                                                <ext:Model ID="Model2" runat="server">
                                                    <Fields>
                                                    </Fields>
                                                </ext:Model>
                                            </Model>
                                        </ext:Store>
                                    </Store>
                                </ext:MultiCombo>
                                <ext:TextField runat="server" ID="txtshop" LabelWidth="60" FieldLabel="店铺名称" EmptyText="输入店铺名称" />
                                <ext:Button ID="Button1" runat="server" Text="查询" OnDirectClick="BtnQureyUser" UI="Info">
                                    <DirectEvents>
                                        <Click>
                                            <EventMask ShowMask="true" Msg="加载中...">
                                            </EventMask>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                                <ext:Component runat="server" Margin="3" Width="1400" />
                                <ext:Button ID="Button3" runat="server" Text="获取店铺数据" OnDirectClick="BtnQureyData"
                                    UI="Info">
                                    <DirectEvents>
                                        <Click>
                                            <EventMask ShowMask="true" Msg="加载中...">
                                            </EventMask>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                                <ext:Button ID="Button4" runat="server" Text="批量关联卡门ERP店铺" OnDirectClick="BtnGetErpShop"
                                    UI="Success">
                                    <DirectEvents>
                                        <Click>
                                            <EventMask ShowMask="true" Msg="加载中...">
                                            </EventMask>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Store>
                        <ext:Store ID="Store1" runat="server" PageSize="100" OnReadData="RefreshDataSet"
                            OnSubmitData="Store1_Submit">
                            <Model>
                                <ext:Model ID="Model1" runat="server" IDProperty="mrjshopid">
                                    <Fields>
                                        <ext:ModelField Name="mrjshopid" Mapping="美人计店铺编号" />
                                        <ext:ModelField Name="mrjshopcode" Mapping="美人计店铺ID" />
                                        <ext:ModelField Name="mrjshopname" Mapping="美人计店铺名称" />
                                        <ext:ModelField Name="mrjgetdate" Mapping="获取时间" />
                                        <ext:ModelField Name="kmshopid" Mapping="卡门店铺ID" />
                                        <ext:ModelField Name="kmshopname" Mapping="卡门店铺名称" />
                                        <ext:ModelField Name="kmshopaddrr" Mapping="卡门店铺地址" />
                                        <ext:ModelField Name="crtdate" Mapping="关联时间" />
                                        <ext:ModelField Name="creator" Mapping="操作员" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server">
                            <DirectEvents>
                                <Select OnEvent="Cell_Click" />
                            </DirectEvents>
                        </ext:RowSelectionModel>
                    </SelectionModel>
                    <Listeners>
                        <CellDblClick Handler="#{Window1}.show();CompanyX.OpenShop();">
                        </CellDblClick>
                    </Listeners>
                    <BottomBar>
                        <ext:PagingToolbar ID="PagingToolbar1" runat="server">
                            <Items>
                                <ext:Label ID="Label1" runat="server" Text="每页显示:" />
                                <ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" Width="10" />
                                <ext:ComboBox ID="ComboBox1" runat="server" Width="80">
                                    <Items>
                                        <ext:ListItem Text="10" />
                                        <ext:ListItem Text="20" />
                                        <ext:ListItem Text="50" />
                                        <ext:ListItem Text="100" />
                                    </Items>
                                    <SelectedItems>
                                        <ext:ListItem Value="50" />
                                    </SelectedItems>
                                    <Listeners>
                                        <Select Handler="#{GridPanel1}.store.pageSize = parseInt(this.getValue(), 10); #{GridPanel1}.store.reload();" />
                                    </Listeners>
                                </ext:ComboBox>
                                <ext:Button ID="Button2" runat="server" Text="导出Excel" Icon="PageExcel">
                                    <Listeners>
                                        <Click Handler="exportData('xls');" />
                                    </Listeners>
                                </ext:Button>
                            </Items>
                            <Plugins>
                                <ext:ProgressBarPager ID="ProgressBarPager1" runat="server" />
                            </Plugins>
                        </ext:PagingToolbar>
                    </BottomBar>
                </ext:GridPanel>
                <ext:Window ID="Window1" runat="server" Title="关联店铺资料" Icon="Accept" Height="400"
                    Width="800" Hidden="true" Layout="FitLayout">
                    <Items>
                        <ext:GridPanel ID="GridPanel2" runat="server">
                            <TopBar>
                                <ext:Toolbar ID="Toolbar2" runat="server" Layout="ColumnLayout">
                                    <Items>
                                        <ext:TextField runat="server" ID="txtqshop" EmptyText="输入查找条件" />
                                        <ext:Button ID="Button5" runat="server" Text="查询" OnDirectClick="BtnQureyShop" UI="Info">
                                            <DirectEvents>
                                                <Click>
                                                    <EventMask ShowMask="true" Msg="加载中...">
                                                    </EventMask>
                                                </Click>
                                            </DirectEvents>
                                        </ext:Button>
                                    </Items>
                                </ext:Toolbar>
                            </TopBar>
                            <Store>
                                <ext:Store ID="Store4" runat="server" PageSize="100">
                                    <Model>
                                        <ext:Model ID="Model4" runat="server" IDProperty="shopid">
                                            <Fields>
                                                <ext:ModelField Name="shopid" />
                                                <ext:ModelField Name="shopcode" />
                                                <ext:ModelField Name="shopname" />
                                            </Fields>
                                        </ext:Model>
                                    </Model>
                                </ext:Store>
                            </Store>
                            <ColumnModel>
                                <Columns>
                                    <ext:CommandColumn runat="server" Header="操作">
                                        <Commands>
                                            <ext:GridCommand Icon="Accept" Text="选择" CommandName="Shopselect" />
                                        </Commands>
                                        <DirectEvents>
                                            <Command OnEvent="Shopselect">
                                                <ExtraParams>
                                                    <ext:Parameter Name="shopid" Value="record.data.shopid" Mode="Raw" />
                                                    <ext:Parameter Name="shopname" Value="record.data.shopname" Mode="Raw" />
                                                </ExtraParams>
                                            </Command>
                                        </DirectEvents>
                                    </ext:CommandColumn>
                                    <ext:Column ID="Column1" runat="server" Text="店铺ID" DataIndex="shopid" />
                                    <ext:Column ID="Column2" runat="server" Text="店铺编号" DataIndex="shopcode" />
                                    <ext:Column ID="Column3" runat="server" Text="店铺简称" DataIndex="shopname" Width="250" />
                                </Columns>
                            </ColumnModel>
                           <SelectionModel>
                            <ext:RowSelectionModel ID="RowSelectionModel2" runat="server" />
                           </SelectionModel>
                            <BottomBar>
                                <ext:PagingToolbar ID="PagingToolbar2" runat="server">
                                    <Items>
                                        <ext:Label ID="Label2" runat="server" Text="每页显示:" />
                                        <ext:ToolbarSpacer ID="ToolbarSpacer2" runat="server" Width="10" />
                                        <ext:ComboBox ID="ComboBox2" runat="server" Width="80">
                                            <Items>
                                                <ext:ListItem Text="10" />
                                                <ext:ListItem Text="20" />
                                                <ext:ListItem Text="50" />
                                                <ext:ListItem Text="100" />
                                            </Items>
                                            <SelectedItems>
                                                <ext:ListItem Value="50" />
                                            </SelectedItems>
                                            <Listeners>
                                                <Select Handler="#{GridPanel2}.store.pageSize = parseInt(this.getValue(), 10); #{GridPanel2}.store.reload();" />
                                            </Listeners>
                                        </ext:ComboBox>
                                    </Items>
                                    <Plugins>
                                        <ext:ProgressBarPager ID="ProgressBarPager2" runat="server" />
                                    </Plugins>
                                </ext:PagingToolbar>
                            </BottomBar>
                        </ext:GridPanel>
                    </Items>
                </ext:Window>
            </Items>
        </ext:Viewport>
    </div>
    </form>
</body>
</html>
